分页判断进阶,在第一页时隐藏首页和上一页按钮,在最后一页时隐藏下一页和尾页按钮
时间 :
2022-08-11
编辑 :超级管理员
<code>{pboot@if({page:rows}>0)} <div class="page"> <a href="{page:index}"{pboot:2if('{page:current}'==1)}class="hide"{/pboot:2if}>首页</a> <!--在第一页时,当前页码‘{page:current}’等于1,添加‘hide’样式,.hide{dispaly:none;}--> <a href="{page:pre}"{pboot:2if('{page:current}'==1)}class="hide"{/pboot:2if}>上一页</a> <!--与上条同理--> {page:numbar} <a href="{page:next}"{pboot:2if('{page:current}'=='{page:count}')}class="hide"{/pboot:2if}>下一页</a> <!--在最后一页时,当前页码‘{page:current}’等于总页数‘{page:count},’添加‘hide’样式,.hide{dispaly:none;}--> <a href="{page:last}"{pboot:2if('{page:current}'=='{page:count}')}class="hide"{/pboot:2if}>尾页</a><!--与上条同理--> </div> {else} <div class="page">暂无内容</div> {/pboot@if} </code>
分页判断进阶,在第一页时隐藏首页和上一页按钮,在最后一页时隐藏下一页和尾页按钮